<?php
class Image extends LilgalleryAppModel {
	var $name = 'Image';
	
	var $actsAs = array('Containable',
		'ImageUpload' => array(
			'dirField'	=> false,
			'baseDir'	=> '{WWW_ROOT}img{DS}originals{DS}',
			'dirFormat' => '{$gallery_id}',
			'overwriteExisting' => false,
			'versions' => array(
				'thumb' => array(
					'vBaseDir'	=> '{WWW_ROOT}img{DS}thumbs{DS}',
					'vDirFormat'	=> '{$gallery_id}',
					'vFileFormat'	=> '{$filename}',
					'callback'		=> array('resize', 150, 150)
				),
				'original' => array(
					'vBaseDir'	=> '{WWW_ROOT}img{DS}galleries{DS}',
					'vDirFormat'	=> '{$gallery_id}',
					'vFileFormat'	=> '{$filename}',
					'callback'		=> array('resize', 640, 640)
				),
				/*
				'copy' => array(
					'vBaseDir' => '{WWW_ROOT}files/',
					'vDirFormat' => '{$dir}/',
					'vFileFormat' => '{$filename}',
					'callback' => array('copy', '{$vAbsolute}')
				)
			 */
			),
		)
	);
	
	var $belongsTo = array(
		'Gallery' => array(
			'className'	=> 'Lilgallery.Gallery',
			'counterCache' => true
		)
	);

}
?>